# Contributor: Tom Newsom <Jeepster@gmx.co.uk>
# Contributor: Jason Chu <jason@archlinux.org>
# Maintainer: schuay <jakob.gruber@gmail.com>

pkgname=enigma
pkgver=1.04
pkgrel=7
pkgdesc=" Enigma is a puzzle game involving falling blocks"
arch=('loong64' 'x86_64')
url="https://www.chiark.greenend.org.uk/~sgtatham/enigma/"
license=('custom')
depends=('ncurses')
source=("https://www.chiark.greenend.org.uk/~sgtatham/$pkgname/$pkgname-$pkgver.tar.gz")
sha512sums=('a7de38cfae06b82c6b7007167157f65d7dd7cd9da5647896a78aff6ddcc8f4290103e6a9f5eb156fd63c2b763687f12eec0f29f5b9813bd2ca63f8b3ed2fda83')

build() {
  cd $srcdir/$pkgname-$pkgver
  autoconf # Default CPP and CPPFLAGS cause errors. See FS#36228.
  ./configure --prefix=/usr --localstatedir=/var
  sed -i "s/root\.games/root.root/" Makefile
  make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  mkdir -p $pkgdir/usr/bin
  make prefix=$pkgdir/usr localstatedir=$pkgdir/var install
  install -Dm644 LICENCE ${pkgdir}/usr/share/licenses/${pkgname}/license
}
